package com.example.lastwork.dao;

import com.example.lastwork.common.dao.LogicDAO;
import com.example.lastwork.entity.Orders;
import com.example.lastwork.entity.Shop;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;


public interface ShopDao extends LogicDAO<Shop, Long> {
    @Query("SELECT o FROM Orders o WHERE o.shop.id = :shopId")
    List<Orders> getOrdersList(@Param(value = "shopId") Long shopId);

    @Query("SELECT s FROM Shop s")
    List<Shop> getAllShop();

    @Query("SELECT s FROM Shop s WHERE s.business.id = :businessId")
    List<Shop> getMyShop(@Param(value = "businessId") Long businessId);
}
